﻿using Microsoft.AspNetCore.Mvc;
using sqlsugar.lib;
using System.Threading.Tasks;

namespace orm.demo.Controllers
{
    public class SqlSugarController : Controller
    {
        private readonly ISqlSugarRepository _sqlSugarRepository;
        public SqlSugarController(ISqlSugarRepository sqlSugarRepository)
        {
            _sqlSugarRepository = sqlSugarRepository;
        }
        public async Task<IActionResult> Index()
        {
            string sql = "select * from students";
            await _sqlSugarRepository.GetPage(sql, 1, 100);
            return View();
        }
    }
}
